<?php
require(dirname(__FILE__) .'/includes/chart.php');
require(dirname(__FILE__) . '/includes/init.php');
if($_REQUEST['act']=='view'){
	$sql = "select * from ".$ecs->table('jingdong')." where products_sn='".$_REQUEST['sn']."' order by id";
	$youhi_list = $db->getAll($sql);
	$data = array();
	$data1 = array();
	foreach($youhi_list as $index=>$youhi){
		$data[$index] = $youhi_list[$index]['ranking'];
		$data1[$index] = date('m-d H:i',$youhi_list[$index]['add_time']);
	}
}

//echo $_SERVER['HTTP_ACCEPT_CHARSET'];exit;
$chart = new chart(1000,600, false);
$chart->plot($data,false,"red",'square');
$chart->set_x_ticks($data1,'text');
//$chart->set_labels("Day","Ranking");
$chart->set_title(iconv('UTF-8', 'GB2312',$youhi_list[0]['products_name']),'red');
$chart->stroke();
?>

